﻿<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %> 
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %> 
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WeeklyReportUserControl.ascx.cs" Inherits="CSSoft.VNTower.WeeklyReport.WeeklyReportUserControl" %>
<%@ Register Assembly="Telerik.Web.UI, Version=2011.1.322.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
    Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<style type="text/css">
    .PageWidth{width: 1200px;}
    .HeaderLable {
        background-color: #000080; 
        color: #FFFFFF; 
    }
    .FieldLable{background-color: #CCFFCC;}
    .Center{text-align: center;}
    .Right{text-align: right;}
    .Top{vertical-align: top;}
</style>
<h1 class="PageWidth HeaderLable Center"> BÁO CÁO TUẦN (WEEKLY REPORT)</h1>
<table class="PageWidth">
<tr>
<td class="FieldLable">Họ tên/Name</td>
<td colspan="3">
    <telerik:RadTextBox ID="Name" Runat="server" Skin="Windows7" Width="98%" ReadOnly="True">
    </telerik:RadTextBox>
    </td>
<td rowspan="2" class="FieldLable Center" width="60px">
    TO</td>
<td rowspan="2" width="686px">
    <SharePoint:PeopleEditor ID="EmailTo" runat="server"
        AllowEmpty="true" MultiSelect="true" AllowTypeIn="true"  
        PlaceButtonsUnderEntityEditor="false" SelectionSet="User" BorderColor="#B8CBDE" BorderStyle="Solid" BorderWidth="1px" Width="98%" Height="100%" />
 </td>
</tr>
<tr>
<td class="FieldLable">Mã NV/Code</td>
<td colspan="3">
    <telerik:RadTextBox ID="Code" Runat="server" Skin="Windows7" Width="98%" ReadOnly="True">
    </telerik:RadTextBox>
    </td>
</tr>
<tr>
<td class="FieldLable">Chức vụ/Title</td>
<td colspan="3">
    <telerik:RadTextBox ID="Title" Runat="server" Skin="Windows7" Width="98%" ReadOnly="True">
    </telerik:RadTextBox>
    </td>
<td rowspan="3" class="FieldLable Center">
    CC</td>
<td rowspan="3">    
    <SharePoint:PeopleEditor ID="EmailCC" runat="server"
        AllowEmpty="true" MultiSelect="true" AllowTypeIn="true"  BorderColor="#B8CBDE" BorderStyle="Solid" BorderWidth="1px"
        PlaceButtonsUnderEntityEditor="false" SelectionSet="User" Width="98%" Height="100%"/></td>
</tr>
<tr>
<td class="FieldLable">Phòng/Division</td>
<td colspan="3">
    <telerik:RadTextBox ID="Division" Runat="server" Skin="Windows7" Width="98%" ReadOnly="True">
    </telerik:RadTextBox>
    </td>
</tr>
<tr>
<td class="FieldLable">Vùng/Region</td>
<td colspan="3">
    <telerik:RadTextBox ID="Region" Runat="server" Skin="Windows7" Width="98%" ReadOnly="True">
    </telerik:RadTextBox>
    </td>
</tr>
<tr>
<td class="FieldLable">Tuần/Week #</td>
<td>
    <telerik:RadComboBox ID="Week" Runat="server" Skin="Office2007" AutoPostBack="true" 
        Width="98%" onselectedindexchanged="Week_SelectedIndexChanged">
    </telerik:RadComboBox>
    </td>
<td class="FieldLable">Năm/Year</td>
<td>
    <telerik:RadComboBox ID="Year" Runat="server" Skin="Office2007" AutoPostBack="true"
        Width="98%" onselectedindexchanged="Year_SelectedIndexChanged">
    </telerik:RadComboBox>
    </td>
<td rowspan="2" class="FieldLable Center">
    Ghi chú /<br />
    Note</td>
<td rowspan="2">
    <telerik:RadTextBox ID="Note" Runat="server" Skin="Windows7" 
        TextMode="MultiLine" Width="98%" Height="48px">
    </telerik:RadTextBox>
    </td>
</tr>
<tr>
<td class="FieldLable">Từ ngày/From</td>
<td>
    <telerik:RadDatePicker ID="From" Runat="server" Skin="Office2007" 
        Width="98%" Culture="en-US" AutoPostBack="true"
        onselecteddatechanged="From_SelectedDateChanged">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
            ViewSelectorText="x" Skin="Office2007"></Calendar>

<DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" AutoPostBack="True"></DateInput>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
    </telerik:RadDatePicker>
    </td>
<td class="FieldLable">Đến ngày/Till</td>
<td>
    <telerik:RadDatePicker ID="Till" Runat="server" Skin="Office2007" 
        Width="98%" Culture="en-US" AutoPostBack="true"
        onselecteddatechanged="Till_SelectedDateChanged">
<Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False" 
            ViewSelectorText="x" Skin="Office2007"></Calendar>

<DateInput DisplayDateFormat="dd/MM/yyyy" DateFormat="dd/MM/yyyy" AutoPostBack="True"></DateInput>

<DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
    </telerik:RadDatePicker>
    </td>
</tr>
</table>
<br />
<p>
    <strong> A. BÁO CÁO TÌNH HÌNH CÔNG VIỆC ĐƯỢC GIAO TRONG TUẦN<br />
REPORT OF TASKS ASSIGNED IN THE WEEK</strong>
</p>
<script type="text/javascript">
        <!--
    var hasChanges, editedRow;

    function ReportTasksAssignedRowClick(sender, eventArgs) {
        if (editedRow && hasChanges) {
            hasChanges = false;
            if (confirm("Update changes?")) {

                $find("<%= ReportTasksAssigned.ClientID %>").get_masterTableView().updateItem(editedRow);
            }
        }
    }

    function ReportTasksAssignedRowDblClick(sender, eventArgs) {
        editedRow = eventArgs.get_itemIndexHierarchical();
        $find("<%= ReportTasksAssigned.ClientID %>").get_masterTableView().editItem(editedRow);
    }

    function ReportTasksAssignedGridCommand(sender, args) {
        if (args.get_commandName() != "Edit") {
            editedRow = null;
        }
    }
     -->    
    </script>
<telerik:RadGrid ID="ReportTasksAssigned" runat="server" Skin="Windows7" 
    AutoGenerateColumns="False" CellSpacing="0" GridLines="None" 
    CssClass="PageWidth" OnNeedDataSource="ReportTasksAssigned_NeedDataSource" 
    ShowGroupPanel="True" OnUpdateCommand="ReportTasksAssigned_UpdateCommand" 
    onitemdatabound="ReportTasksAssigned_ItemDataBound">
    <GroupPanel Text="Kéo một cột vào đây để nhóm theo cột đó &lt;br/&gt; Drag a column header and drop it here to group by that column">
    </GroupPanel>
<MasterTableView EditMode="InPlace">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <SelectFields>
                <telerik:GridGroupByField HeaderText="Mã DA/Project Code" FieldName="ProjectCode"></telerik:GridGroupByField>
            </SelectFields>
            <GroupByFields>
                <telerik:GridGroupByField FieldName="ProjectCode"></telerik:GridGroupByField>
            </GroupByFields>
        </telerik:GridGroupByExpression>
    </GroupByExpressions>
    <Columns>
        <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column">
        </telerik:GridEditCommandColumn>
        <telerik:GridTemplateColumn FilterControlAltText="Filter Title column" 
            UniqueName="Title" HeaderText="Tên công việc được giao&lt;br /&gt;Assigned task name">
            <ItemTemplate>
                <asp:Literal ID="Title" runat="server" Text='<%# Eval("Title") %>'></asp:Literal>
                <asp:HiddenField ID="IsReporter" runat="server" Value='<%# Eval("IsReporter") %>' />
                <asp:HiddenField ID="IsProjectManager" runat="server" Value='<%# Eval("IsProjectManager") %>' />
            </ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridBoundColumn DataField="ProjectCode" 
            FilterControlAltText="Filter ProjectCode column" 
            HeaderText="Mã DA&lt;br/&gt;Project Code" ReadOnly="True" UniqueName="ProjectCode">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="Delay" 
            FilterControlAltText="Filter Delay column" 
            HeaderText="trễ DA?&lt;br/&gt;Delay?" UniqueName="Delay">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="ReasonDelay" 
            FilterControlAltText="Filter ReasonDelay column" 
            HeaderText="Lý do trễ (Nếu có)&lt;br/&gt;Reason of delay (If need)" 
            UniqueName="ReasonDelay">
        </telerik:GridBoundColumn>
        <telerik:GridNumericColumn DataField="PercentComplete" DecimalDigits="2" 
            FilterControlAltText="Filter PercentComplete column" 
            HeaderText="% Xong&lt;br/&gt;% Done" NumericType="Percent" UniqueName="PercentComplete">
        </telerik:GridNumericColumn>
        <telerik:GridDateTimeColumn DataField="FS" DataFormatString="{0:dd/MM/yyyy}" 
            FilterControlAltText="Filter FS column" HeaderText="F.S&lt;br/&gt;(Time)"
            UniqueName="FS">
        </telerik:GridDateTimeColumn>
        <telerik:GridDateTimeColumn DataField="FF" 
            FilterControlAltText="Filter FF column" HeaderText="F.F&lt;br/&gt;(Time)"
            UniqueName="FF" DataFormatString="{0:dd/MM/yyyy}">
        </telerik:GridDateTimeColumn>
        <telerik:GridDateTimeColumn DataField="AS" 
            FilterControlAltText="Filter AS column" HeaderText="A.S&lt;br/&gt;(Time)" 
            UniqueName="AS" DataFormatString="{0:dd/MM/yyyy}">
        </telerik:GridDateTimeColumn>
        <telerik:GridDateTimeColumn DataField="AF" 
            FilterControlAltText="Filter AF column" HeaderText="A.F&lt;br/&gt;(Time)" 
            UniqueName="AF" DataFormatString="{0:dd/MM/yyyy}">
        </telerik:GridDateTimeColumn>
        <telerik:GridCheckBoxColumn DataField="PMAprovedCheckBox" 
            FilterControlAltText="Filter Aprove column" 
            UniqueName="PMAprovedCheckBox">
        </telerik:GridCheckBoxColumn>
        <telerik:GridBoundColumn DataField="PMComment" 
            FilterControlAltText="Filter PMComment column" 
            HeaderText="Ý KIẾN CỦA CHỦ NHIỆM DA/NGƯỜI QUẢN LÝ&lt;br/&gt;PM/DIRECT MANAGER's JUDGERMENT" 
            UniqueName="PMComment">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="False" DataType="System.Int64"/>
    </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter PMComment column"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True">
    <ClientEvents OnRowClick="ReportTasksAssignedRowClick" OnRowDblClick="ReportTasksAssignedRowDblClick"
        OnCommand="ReportTasksAssignedGridCommand" />
</ClientSettings>
<FilterMenu EnableImageSprites="False"></FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007"></HeaderContextMenu>
</telerik:RadGrid>
<br />
<p>
    <strong> B. PHƯƠNG ÁN LÀM VIỆC ĐẢM BẢO TIẾN ĐỘ &amp; CHẤT LƯỢNG (NẾU BỊ trễ HOẶC CÓ 
SỰ CỐ)<br />
ACTION REGISTER TO ENSURE PROGRESS &amp; QUALITY OF TASK (IN CASE OF DELAY OR 
QUATILY ISSUES)</strong>
</p>
<script type="text/javascript">
        <!--
    var hasChangesActionRegister, editedRowActionRegister;

    function ActionRegisterRowClick(sender, eventArgs) {
        if (editedRowActionRegister && hasChangesActionRegister) {
            hasChangesActionRegister = false;
            if (confirm("Update changes?")) {

                $find("<%= ActionRegister.ClientID %>").get_masterTableView().updateItem(editedRowActionRegister);
            }
        }
    }

    function ActionRegisterRowDblClick(sender, eventArgs) {
        editedRowActionRegister = eventArgs.get_itemIndexHierarchical();
        $find("<%= ActionRegister.ClientID %>").get_masterTableView().editItem(editedRowActionRegister);
    }

    function ActionRegisterGridCommand(sender, args) {
        if (args.get_commandName() != "Edit") {
            editedRowActionRegister = null;
        }
    }
     -->    
    </script>
<telerik:RadGrid ID="ActionRegister" runat="server" Skin="Windows7" 
    AutoGenerateColumns="False" CellSpacing="0" GridLines="None" 
    CssClass="PageWidth" onneeddatasource="ActionRegister_NeedDataSource" 
    ShowGroupPanel="True" onupdatecommand="ActionRegister_UpdateCommand" 
    onitemdatabound="ActionRegister_ItemDataBound">
    <GroupPanel Text="Kéo một cột vào đây để nhóm theo cột đó &lt;br/&gt; Drag a column header and drop it here to group by that column">
    </GroupPanel>
<MasterTableView EditMode="InPlace">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>

<ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
    <GroupByExpressions>
        <telerik:GridGroupByExpression>
            <SelectFields>
                <telerik:GridGroupByField HeaderText="Mã DA/Project Code" FieldName="ProjectCode"></telerik:GridGroupByField>
            </SelectFields>
            <GroupByFields>
                <telerik:GridGroupByField FieldName="ProjectCode"></telerik:GridGroupByField>
            </GroupByFields>
        </telerik:GridGroupByExpression>
    </GroupByExpressions>
    <Columns>
        <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column">
        </telerik:GridEditCommandColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter column column" 
            HeaderText="Tên công việc bị trễ tiến độ&lt;br/&gt;Assigned task name" 
            ReadOnly="True" UniqueName="Title" DataField="Title">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter ProjectCode column" 
            HeaderText="Mã DA&lt;br/&gt;Project Code" ReadOnly="True" 
            UniqueName="ProjectCode" DataField="ProjectCode">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="ActionRegister" 
            FilterControlAltText="Filter ActionRegister column" 
            HeaderText="Phương án cứu tiến độ/Khắc phục lỗi&lt;br/&gt;Action register to rescue delay/problem" 
            UniqueName="ActionRegister">
        </telerik:GridBoundColumn>
        <telerik:GridDateTimeColumn FilterControlAltText="Filter PlannedFinish column" 
            HeaderText="Dự kiến ngày xong&lt;br/&gt;Planned Finish Date" 
            UniqueName="PlannedFinish" DataField="PlannedFinish" DataFormatString="{0:dd/MM/yyyy}">
        </telerik:GridDateTimeColumn>
        <telerik:GridBoundColumn FilterControlAltText="Filter WorkingPlace column" 
            HeaderText="Nơi làm việc&lt;br/&gt;Working place" UniqueName="WorkingPlace" 
            DataField="WorkingPlace">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Note" 
            FilterControlAltText="Filter Note column" HeaderText="Ghi chú&lt;br/&gt;Note" 
            UniqueName="Note">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Id" UniqueName="Id" Visible="False" DataType="System.Int64"/>
    </Columns>

<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
</MasterTableView>
<ClientSettings AllowDragToGroup="True">
    <ClientEvents OnRowClick="ActionRegisterRowClick" OnRowDblClick="ActionRegisterRowDblClick"
        OnCommand="ActionRegisterGridCommand" />
</ClientSettings>
<FilterMenu EnableImageSprites="False"></FilterMenu>
<HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Office2007"></HeaderContextMenu>
</telerik:RadGrid>
<p>
<table  class="PageWidth"><tr><td class="Center"><telerik:RadButton ID="Submit" runat="server" Skin="Windows7" 
    Text="Submit" onclick="Submit_Click">
</telerik:RadButton>
    <asp:Literal ID="SubmitMessage" runat="server"></asp:Literal>
    </td></tr><tr><td class="Center">&nbsp;</td></tr><tr><td class="Center">
<hr />
</td></tr><tr><td class="Center">
        &nbsp;</td></tr></table>
<table class="PageWidth">
<tr>
<td class="FieldLable" style="width:246px">Ý KIẾN CỦA Q.L.BỘ PHẬN<br />
    LINE MANAGER COMMENT</td>
<td class="Center" colspan="2">
    <telerik:RadTextBox ID="LineManagerComment" Runat="server" Skin="Windows7" 
        TextMode="MultiLine" Width="98%" Height="60px">
    </telerik:RadTextBox>
    </td>
</tr>
<tr>
<td class="FieldLable" style="width:246px">REPORT STATUS</td>
<td>
    <asp:Literal ID="Status" runat="server"></asp:Literal>
    </td>
<td>
    <telerik:RadButton ID="Approved" runat="server" Skin="Windows7" 
    Text="Approved" onclick="Approved_Click"></telerik:RadButton>
    <telerik:RadButton ID="Rejected" runat="server" Skin="Windows7" 
    Text="Rejected" onclick="Rejected_Click"></telerik:RadButton>
    <asp:Literal ID="ActionMessage" runat="server"></asp:Literal></td>
</tr>
</table>
</p>

